<template>

<el-header>
    <div class="l-content">
      <el-button size="small" plain @click="handleCollapse">
        <el-icon :size="20">
            <Menu/>
        </el-icon>
      </el-button>
      <!-- 面包屑部分 -->
      <!-- <h3>首页</h3> -->
      、<el-breadcrumb separator="/">
    <el-breadcrumb-item :to="{ path: '/' }">homepage</el-breadcrumb-item>
    <el-breadcrumb-item
      ><a href="/">promotion management</a></el-breadcrumb-item
    >
    <el-breadcrumb-item>promotion list</el-breadcrumb-item>
    <el-breadcrumb-item>promotion detail</el-breadcrumb-item>
  </el-breadcrumb>





















    </div>


    <div class="r-content">
     <el-dropdown>
    <span class="el-dropdown-link">
     <!-- <img class="user" src="../assets/images/user.png" alt=""> -->
     <img :src="getImgSrc('user')" alt="图片错误" class="user" />
    </span>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item>个人中心</el-dropdown-item>
        <el-dropdown-item>退出</el-dropdown-item>
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</div>


</el-header>
</template>

<script>

import {useStore} from 'vuex'
export default {
    setup(){
      let store =useStore();
        let getImgSrc=(user)=>{
            return new URL(`../assets/images/${user}.png`,import.meta.url).href;
        };
        let handleCollapse= () => {
          store.commit("updateIsCollapse")
        };
        return{
            getImgSrc,
            handleCollapse,
        };
    },
}
</script>








<style lang="less" scoped>
header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background-color: #333;
}
.r-content{
    .user{
        width: 40px;
        height: 40px;
        border-radius: 50%;
    }
}
.l-content{
  display: flex;
  align-items: center;
  .el-button{
    margin-right: 20px;
  }
  h3{
    color: #fff;
  }
}
</style>

